<template>
  <el-pagination
    :current-page="data.pageNum"
    :page-sizes="[5,10,20,50,100]"
    :page-size="data.pageSize"
    :total="data.total"
    layout="prev, pager, next, jumper,sizes,total"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    @next-click="handelNext"
    @prev-click="handelPrev"
  />
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    data: [Object, Array],
    changeSize: Function,
    changePage: Function
  },
  methods: {
    handleSizeChange(size) {
      this.$emit('change-size', size)
    },
    handleCurrentChange(current) {
      this.$emit('change-page', current)
    },
    handelNext() {
      this.$emit('change-next', 1)
    },
    handelPrev() {
      this.$emit('change-prev', -1)
    }
  }
}
</script>

<style scoped>
</style>
